# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.

defmodule GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdate do
  @moduledoc """
  The following represents a resource describing a single update (rollout) of a group of instances to the given template.

  ## Attributes

  - actionType (String.t): Specifies the action to take for each instance within the instance group. This can be RECREATE which will recreate each instance and is only available for managed instance groups. It can also be REBOOT which performs a soft reboot for each instance and is only available for regular (non-managed) instance groups. Defaults to: `null`.
  - creationTimestamp (String.t): [Output Only] Creation timestamp in RFC3339 text format. Defaults to: `null`.
  - description (String.t): An optional textual description of the resource; provided by the client when the resource is created. Defaults to: `null`.
  - error (RollingUpdateError):  Defaults to: `null`.
  - id (String.t): [Output Only] Unique identifier for the resource; defined by the server. Defaults to: `null`.
  - instanceGroup (String.t): Fully-qualified URL of an instance group being updated. Exactly one of instanceGroupManager and instanceGroup must be set. Defaults to: `null`.
  - instanceGroupManager (String.t): Fully-qualified URL of an instance group manager being updated. Exactly one of instanceGroupManager and instanceGroup must be set. Defaults to: `null`.
  - instanceTemplate (String.t): Fully-qualified URL of an instance template to apply. Defaults to: `null`.
  - kind (String.t): [Output Only] Type of the resource. Defaults to: `null`.
  - oldInstanceTemplate (String.t): Fully-qualified URL of the instance template encountered while starting the update. Defaults to: `null`.
  - policy (RollingUpdatePolicy):  Defaults to: `null`.
  - progress (integer()): [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the update will be complete. This number should be monotonically increasing as the update progresses. Defaults to: `null`.
  - selfLink (String.t): [Output Only] The fully qualified URL for the resource. Defaults to: `null`.
  - status (String.t): [Output Only] Status of the update. Possible values are:   - \&quot;ROLLING_FORWARD\&quot;: The update is going forward.  - \&quot;ROLLING_BACK\&quot;: The update is being rolled back.  - \&quot;PAUSED\&quot;: The update is temporarily paused (inactive).  - \&quot;ROLLED_OUT\&quot;: The update is finished, all instances have been updated successfully.  - \&quot;ROLLED_BACK\&quot;: The update is finished, all instances have been reverted to the previous template.  - \&quot;CANCELLED\&quot;: The update is paused and no longer can be resumed, undefined how many instances are running in which template. Defaults to: `null`.
  - statusMessage (String.t): [Output Only] An optional textual description of the current status of the update. Defaults to: `null`.
  - user (String.t): [Output Only] User who requested the update, for example: user@example.com. Defaults to: `null`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :actionType => any(),
          :creationTimestamp => any(),
          :description => any(),
          :error => GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdateError.t(),
          :id => any(),
          :instanceGroup => any(),
          :instanceGroupManager => any(),
          :instanceTemplate => any(),
          :kind => any(),
          :oldInstanceTemplate => any(),
          :policy => GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdatePolicy.t(),
          :progress => any(),
          :selfLink => any(),
          :status => any(),
          :statusMessage => any(),
          :user => any()
        }

  field(:actionType)
  field(:creationTimestamp)
  field(:description)
  field(:error, as: GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdateError)
  field(:id)
  field(:instanceGroup)
  field(:instanceGroupManager)
  field(:instanceTemplate)
  field(:kind)
  field(:oldInstanceTemplate)
  field(:policy, as: GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdatePolicy)
  field(:progress)
  field(:selfLink)
  field(:status)
  field(:statusMessage)
  field(:user)
end

defimpl Poison.Decoder, for: GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdate do
  def decode(value, options) do
    GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdate.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdate do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
